import request from "@/utils/request";

/**
 * 练习
 */
export const apiGetRepositoryList = (params) => {
  return request.post("/repository/list", params);
};

export const apiGetRepositoryById = (id) => {
  return request.get("/repository/getById?id=" + id);
};

export const apiListQuestionByMode = (params) => {
  return request.post("/practice/listQuestionByMode", params);
};

export const apiSubmitPractice = (params) => {
  return request.post("/practice/submitPractice", params);
};

export const apiGetPracticeResult = (userPracticeId) => {
  return request.get("/practice/getPracticeResult?id=" + userPracticeId);
};

export const apiGetRecentPractice = (repositoryId) => {
  return request.get("/practice/getRecentPractice?repositoryId=" + repositoryId);
};

export const apiUserPracticeList = (params) => {
  return request.post("/practice/userPractice/list", params);
};
